//package com.ourhours.message.configuration;
//
//import com.ourhours.link.interceptor.AuthenticateInterceptor;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
//
///**
// * Description:WebConfiguration.
// *
// * @author xiangyang.liu
// * @version V1.0
// * @since 2017/9/15
// */
//@Configuration
//public class WebConfiguration extends WebMvcConfigurerAdapter {
//
//    @Bean
//    public AuthenticateInterceptor authenticateInterceptor() {
//        return new AuthenticateInterceptor();
//    }
//
//    @Bean
//    public LogInterceptor logInterceptor() {
//        return new LogInterceptor();
//    }
//
//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
//        //registry.addInterceptor(authenticateInterceptor()).addPathPatterns("/**");
////        InterceptorRegistration registrationLog = registry.addInterceptor(logInterceptor());
////        registrationLog.addPathPatterns("/**");
//        //super.addInterceptors(registry);
//    }
//
//
//}
package com.ourhours.message.configuration;

import com.ourhours.link.interceptor.AuthenticateInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * Description:WebConfiguration.
 *
 * @author xiangyang.liu
 * @version V1.0
 * @since 2017/9/15
 */
@Configuration
public class WebConfiguration extends WebMvcConfigurerAdapter {

    @Bean
    public AuthenticateInterceptor authenticateInterceptor() {
        return new AuthenticateInterceptor();
    }

    @Bean
    public LogInterceptor logInterceptor() {
        return new LogInterceptor();
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(authenticateInterceptor()).addPathPatterns("/**");
//        InterceptorRegistration registrationLog = registry.addInterceptor(logInterceptor());
//        registrationLog.addPathPatterns("/**");
        super.addInterceptors(registry);
    }


}




















































































































































